<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- splice(起点，长度)  定点删除
         splice(起点，长度，元素...)  修改  先删除后插入
         splice(起点index,0,元素...)  增加 在起点的前面添加
     -->
    <script>
        var arr = [1,2,3,4,5]
        arr.splice(3,1) //[1,2,3,5]
        console.log(arr);

        var a =[1,2,3,4,5]
        a.splice(2,1,9) // [1,2,9,4,5]
        console.log(a);

        var a =[1,2,3,4]
        a.splice(1,0,8,9)  // [1,8,9,2,3,4]
        console.log(a);
    </script>
</body>
</html>